import Vue from "vue";
import VueRouter from "vue-router";
import Prologue from "@/views/prologue";
Vue.use(VueRouter);
const routes = [{
        path: "/",
        redirect: "/prologue",
    },
    {
        path: "/prologue",
        name: "prologue",
        component: Prologue,
    },
    {
        path: "/login",
        name: "login",
        component: () =>
            import ("@/views/login"),
        meta: { noLogin: true },
    },
    {
        path: "/home",
        name: "home",
        redirect: "/main",
        component: () =>
            import ("@/views/home"),
        children: [{
                path: "/main",
                name: "main",
                component: () =>
                    import ("@/views/main")
            },
            {
                path: "/statistics",
                name: "statistics",
                component: () =>
                    import ("@/views/statistics"),
            },
            {
                path: "/set",
                name: "set",
                component: () =>
                    import ("@/views/set")
            },
            {
                path: "/stock",
                name: "stock",
                component: () =>
                    import ("@/views/stock"),
            },
            {
                path: "/product/list",
                name: "productlist",
                component: () =>
                    import ("@/views/product/productList"),
                 
            }, {
                path: "/product/edit",
                name: "productedit",
                component: () =>
                    import ("@/views/product/productEdit"),
            },
            {
                path: "/recevie/list",
                name: "recevielist",
                component: () =>
                    import ("@/views/recevie/recevieList"),
            },
        ],
    },
    {
        path: "/project/list",
        name: "projectlist",
        component: () =>
            import ("@/views/project/projectList"),
    },
    {
        path: "/project/edit",
        name: "projectedit",
        component: () =>
            import ("@/views/project/projectEdit"),
    },

    {
        path: "/purchase/edit",
        name: "purchaseedit",
        component: () =>
            import ("@/views/purchase/purchaseEdit"),
    },
    {
        path: "/purchase/list",
        name: "purchaselist",
        component: () =>
            import ("@/views/purchase/purchaseList"),
    },
    {
        path: "/purchase/detail",
        name: "purchaseDetail",
        component: () =>
            import ("@/views/purchase/purchaseDetail"),
    },
    {
        path: "/supplier/list",
        name: "supplierlist",
        component: () =>
            import ("@/views/supplier/supplierList"),
    },
    {
        path: "/supplier/edit",
        name: "supplieredit",
        component: () =>
            import ("@/views/supplier/supplierEdit"),
    },
    {
        path: "/recevie/edit",
        name: "recevieedit",
        component: () =>
            import ("@/views/recevie/recevieEdit"),
    }, {
        path: "/recevie/list",
        name: "recevielist",
        component: () =>
            import ("@/views/recevie/recevieList"),
    },
];

const router = new VueRouter({
    mode: "history",
    base: process.env.BASE_URL,
    routes,
});

export default router;